const Koa = require('koa')
const router = require('koa-router')()
const render = require('koa-art-template')
const path = require('path')
const admin = require('./routers/admin')
const api = require('./routers/api')

const app = new Koa()

render(app, {
  root: path.join(__dirname, 'views'),
  extname: '.html',
  debug: process.env.NODE_ENV !== 'production'
})

router.use('/admin', admin.routes())
router.use('/api', api)


app.use(router.routes())
app.use(router.allowedMethods())


app.listen(3000)